<!DOCTYPE html><html><head>
      <title>ReadMe</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      
      <link rel="stylesheet" href="file:///c:\Users\Administrator\.vscode\extensions\shd101wyy.markdown-preview-enhanced-0.8.13\crossnote\dependencies\katex\katex.min.css">
      
      
      
      
      
      <style>
      code[class*=language-],pre[class*=language-]{color:#333;background:0 0;font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.4;-moz-tab-size:8;-o-tab-size:8;tab-size:8;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.8em;overflow:auto;border-radius:3px;background:#f5f5f5}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal;background:#f5f5f5}.token.blockquote,.token.comment{color:#969896}.token.cdata{color:#183691}.token.doctype,.token.macro.property,.token.punctuation,.token.variable{color:#333}.token.builtin,.token.important,.token.keyword,.token.operator,.token.rule{color:#a71d5d}.token.attr-value,.token.regex,.token.string,.token.url{color:#183691}.token.atrule,.token.boolean,.token.code,.token.command,.token.constant,.token.entity,.token.number,.token.property,.token.symbol{color:#0086b3}.token.prolog,.token.selector,.token.tag{color:#63a35c}.token.attr-name,.token.class,.token.class-name,.token.function,.token.id,.token.namespace,.token.pseudo-class,.token.pseudo-element,.token.url-reference .token.variable{color:#795da3}.token.entity{cursor:help}.token.title,.token.title .token.punctuation{font-weight:700;color:#1d3e81}.token.list{color:#ed6a43}.token.inserted{background-color:#eaffea;color:#55a532}.token.deleted{background-color:#ffecec;color:#bd2c00}.token.bold{font-weight:700}.token.italic{font-style:italic}.language-json .token.property{color:#183691}.language-markup .token.tag .token.punctuation{color:#333}.language-css .token.function,code.language-css{color:#0086b3}.language-yaml .token.atrule{color:#63a35c}code.language-yaml{color:#183691}.language-ruby .token.function{color:#333}.language-markdown .token.url{color:#795da3}.language-makefile .token.symbol{color:#795da3}.language-makefile .token.variable{color:#183691}.language-makefile .token.builtin{color:#0086b3}.language-bash .token.keyword{color:#0086b3}pre[data-line]{position:relative;padding:1em 0 1em 3em}pre[data-line] .line-highlight-wrapper{position:absolute;top:0;left:0;background-color:transparent;display:block;width:100%}pre[data-line] .line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}pre[data-line] .line-highlight:before,pre[data-line] .line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}pre[data-line] .line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}html body{font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#333;background-color:#fff;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#000}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#5c5c5c}html body strong{color:#000}html body del{color:#5c5c5c}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ol,html body>ul{margin-bottom:16px}html body ol,html body ul{padding-left:2em}html body ol.no-list,html body ul.no-list{padding:0;list-style-type:none}html body ol ol,html body ol ul,html body ul ol,html body ul ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#5c5c5c;background-color:#f0f0f0;border-left:4px solid #d6d6d6}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#d6d6d6;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:700;color:#000}html body table td,html body table th{border:1px solid #d6d6d6;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em;color:#000;background-color:#f0f0f0;border-radius:3px;padding:.2em 0}html body code::after,html body code::before{letter-spacing:-.2em;content:'\00a0'}html body pre>code{padding:0;margin:0;word-break:normal;white-space:pre;background:0 0;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;line-height:1.45;border:#d6d6d6;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:after,html body pre code:before,html body pre tt:after,html body pre tt:before{content:normal}html body blockquote,html body dl,html body ol,html body p,html body pre,html body ul{margin-top:0;margin-bottom:16px}html body kbd{color:#000;border:1px solid #d6d6d6;border-bottom:2px solid #c7c7c7;padding:2px 4px;background-color:#f0f0f0;border-radius:3px}@media print{html body{background-color:#fff}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#000;page-break-after:avoid}html body blockquote{color:#5c5c5c}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body code,html body pre{word-wrap:break-word;white-space:pre}}.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview ul{list-style:disc}.markdown-preview ul ul{list-style:circle}.markdown-preview ul ul ul{list-style:square}.markdown-preview ol{list-style:decimal}.markdown-preview ol ol,.markdown-preview ul ol{list-style-type:lower-roman}.markdown-preview ol ol ol,.markdown-preview ol ul ol,.markdown-preview ul ol ol,.markdown-preview ul ul ol{list-style-type:lower-alpha}.markdown-preview .newpage,.markdown-preview .pagebreak{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center!important}.markdown-preview:not([data-for=preview]) .code-chunk .code-chunk-btn-group{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .status{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .output-div{margin-bottom:16px}.markdown-preview .md-toc{padding:0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link div,.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.markdown-preview .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0;min-height:100vh}@media screen and (min-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{font-size:14px!important;padding:1em}}@media print{html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{display:none}}html body[for=html-export]:not([data-presentation-mode]) #sidebar-toc-btn{position:fixed;bottom:8px;left:8px;font-size:28px;cursor:pointer;color:inherit;z-index:99;width:32px;text-align:center;opacity:.4}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] #sidebar-toc-btn{opacity:1}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc{padding:0 16px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link div,html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 300px / 2);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

      </style>
      <!-- The content below will be included at the end of the <head> element. --><script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function () {
    // your code here
  });
</script></head><body for="html-export">
    
    
      <div class="crossnote markdown-preview  ">
      
<h1 id="dssidynamic-submarine-script-injector-faction-craft-派系工艺-abbreviationdfc-v01">DSSI(Dynamic Submarine Script Injector) Faction Craft 派系工艺 (Abbreviation:DFC) v0.1 </h1>
<ul>
<li><a href="#dssidynamic-submarine-script-injector-faction-craft-%E6%B4%BE%E7%B3%BB%E5%B7%A5%E8%89%BA-abbreviationdfc-v01">DSSI(Dynamic Submarine Script Injector) Faction Craft 派系工艺 (Abbreviation:DFC) v0.1</a>
<ul>
<li><a href="#%E7%AE%80%E4%BB%8B">简介</a></li>
<li><a href="#%E9%87%8D%E7%94%9F%E7%B3%BB%E7%BB%9F">重生系统</a></li>
<li><a href="#%E5%88%9D%E5%A7%8B%E5%8C%96">初始化</a>
<ul>
<li><a href="#%E5%86%85%E9%83%A8%E7%BC%96%E8%BE%91%E5%99%A8%E5%B7%A5%E5%85%B7%E5%AE%9E%E7%8E%B0%E5%8F%AF%E9%80%89%E6%8E%A8%E8%8D%90">内部编辑器工具实现(可选,推荐)</a></li>
</ul>
</li>
<li><a href="#%E5%B7%A5%E5%85%B7">工具</a>
<ul>
<li><a href="#-%E5%88%9D%E5%A7%8B%E5%8C%96%E5%99%A8dfc_initializer-c%E7%BB%84%E4%BB%B6dfcinitializer">☑ 初始化器(dfc_initializer) C#组件(DfcInitializer)</a></li>
<li><a href="#-%E6%96%B0%E5%A2%9E%E5%87%BA%E7%94%9F%E5%8C%BAdfc_newspawnpointset-c%E7%BB%84%E4%BB%B6dfcnewspawnpointset">☑ 新增出生区(dfc_newspawnpointset) C#组件(DfcNewSpawnPointSet)</a></li>
<li><a href="#-%E6%96%B0%E5%A2%9E%E6%B4%BE%E7%B3%BBdfc_newfaction-c%E7%BB%84%E4%BB%B6dfcnewfaction">☑ 新增派系(dfc_newfaction) C#组件(DfcNewFaction)</a></li>
<li><a href="#-%E6%96%B0%E5%A2%9E%E8%81%8C%E4%B8%9Adfc_newjob-c%E7%BB%84%E4%BB%B6dfcnewjob">☑ 新增职业(dfc_newjob) C#组件(DfcNewJob)</a></li>
<li><a href="#-%E6%96%B0%E5%A2%9E%E8%A3%85%E5%A4%87dfc_newgear-c%E7%BB%84%E4%BB%B6dfcnewgear">☑ 新增装备(dfc_newgear) C#组件(DfcNewGear)</a></li>
<li><a href="#-%E5%85%81%E8%AE%B8%E6%B4%BE%E7%B3%BB%E9%87%8D%E7%94%9Fdfc_allowrespawn-c%E7%BB%84%E4%BB%B6dfcallowrespawn">☑ 允许派系重生(dfc_allowrespawn) C#组件(DfcAllowRespawn)</a></li>
<li><a href="#-%E6%B7%BB%E5%8A%A0%E6%88%96%E7%A7%BB%E9%99%A4%E8%81%8C%E4%B8%9Adfc_addorremovejob-c%E7%BB%84%E4%BB%B6dfcaddorremovejob">☑ 添加或移除职业(dfc_addorremovejob) C#组件(DfcAddOrRemoveJob)</a></li>
<li><a href="#-%E6%B7%BB%E5%8A%A0%E6%88%96%E7%A7%BB%E9%99%A4%E8%A3%85%E5%A4%87dfc_addorremovegear-c%E7%BB%84%E4%BB%B6dfcaddorremovegear">☑ 添加或移除装备(dfc_addorremovegear) C#组件(DfcAddOrRemoveGear)</a></li>
<li><a href="#-lua%E7%BB%84%E4%BB%B6dfc_luacomponent-c%E7%BB%84%E4%BB%B6dfcluacomponent">☑ Lua组件(dfc_luacomponent) C#组件(DfcLuaComponent)</a></li>
<li><a href="#-lua%E7%BB%84%E4%BB%B62%E4%BB%A3dfc_lua2component-c%E7%BB%84%E4%BB%B6dfclua2component">☑ Lua组件2代(dfc_lua2component) C#组件(DfcLua2Component)</a>
<ul>
<li><a href="#chunk%E5%9D%97%E6%89%80%E5%9C%A8%E4%BD%9C%E7%94%A8%E5%9F%9F%E5%8C%85%E5%90%AB%E7%9A%84%E5%8F%98%E9%87%8F%E5%88%97%E8%A1%A8">Chunk块所在作用域包含的变量列表</a></li>
<li><a href="#%E7%A4%BA%E4%BE%8B%E4%B8%80">示例一</a></li>
<li><a href="#%E7%A4%BA%E4%BE%8B%E4%BA%8C">示例二</a></li>
<li><a href="#%E7%A4%BA%E4%BE%8B%E4%B8%89">示例三</a></li>
<li><a href="#%E7%A4%BA%E4%BE%8B%E5%9B%9B">示例四</a></li>
</ul>
</li>
<li><a href="#-%E4%BC%A0%E9%80%81%E7%82%B9dfc_teleporter-c%E7%BB%84%E4%BB%B6dfcteleporter">☑ 传送点(dfc_teleporter) C#组件(DfcTeleporter)</a></li>
<li><a href="#-%E6%95%B0%E6%8D%AE%E8%8E%B7%E5%8F%96%E5%99%A8dfc_datagetter-c%E7%BB%84%E4%BB%B6dfcdatagetter">☑ 数据获取器(dfc_datagetter) C#组件(DfcDataGetter)</a></li>
<li><a href="#-%E6%95%B0%E6%8D%AE%E8%AE%BE%E7%BD%AE%E5%99%A8dfc_datasetter-c%E7%BB%84%E4%BB%B6dfcdatasetter">☑ 数据设置器(dfc_datasetter) C#组件(DfcDataSetter)</a></li>
<li><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">☑ 包含区域(dfc_regionincluded)</a></li>
<li><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">☑ 不包含区域(dfc_regionexcluded)</a></li>
<li><a href="#-%E8%A7%92%E8%89%B2%E6%A3%80%E6%B5%8B%E5%99%A8dfc_characterchecker-c%E7%BB%84%E4%BB%B6dfccharacterchecker">☑ 角色检测器(dfc_characterchecker) C#组件(DfcCharacterChecker)</a></li>
<li><a href="#-%E8%A7%92%E8%89%B2%E6%A3%80%E6%9F%A5%E5%99%A8%E5%8D%95%E4%B8%AAdfc_charactersinglechecker-c%E7%BB%84%E4%BB%B6dfccharactersinglechecker">☑ 角色检查器(单个)(dfc_charactersinglechecker) C#组件(DfcCharacterSingleChecker)</a></li>
<li><a href="#-%E5%8A%A8%E4%BD%9C-%E7%BB%93%E6%9D%9F%E6%B8%B8%E6%88%8Fdfc_actionendgame-c%E7%BB%84%E4%BB%B6dfcactionendgame">☑ 动作† 结束游戏(dfc_actionendgame) C#组件(DfcActionEndGame)</a></li>
<li><a href="#-%E5%8A%A8%E4%BD%9C-%E5%8F%91%E9%80%81%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AFdfc_actionsendchatmessage-c%E7%BB%84%E4%BB%B6dfcactionsendchatmessage">☑ 动作† 发送聊天消息(dfc_actionsendchatmessage) C#组件(DfcActionSendChatMessage)</a></li>
<li><a href="#-%E4%BA%8B%E4%BB%B6-%E8%BF%9B%E5%87%BA%E5%8C%BA%E5%9F%9Fdfc_evententerleaveregion-c%E7%BB%84%E4%BB%B6dfcevententerleaveregion">☑ 事件☇ 进出区域(dfc_evententerleaveregion) C#组件(DfcEventEnterLeaveRegion)</a></li>
<li><a href="#-%E4%BA%8B%E4%BB%B6-%E6%AD%BB%E4%BA%A1dfc_eventcharacterdeath-c%E7%BB%84%E4%BB%B6dfceventcharacterdeath">☑ 事件☇ 死亡(dfc_eventcharacterdeath) C#组件(DfcEventCharacterDeath)</a></li>
<li><a href="#-%E8%A7%92%E8%89%B2%E6%B8%85%E9%99%A4%E5%99%A8dfc_charactercleaner-c%E7%BB%84%E4%BB%B6dfccharactercleaner">☑ 角色清除器(dfc_charactercleaner) C#组件(DfcCharacterCleaner)</a></li>
<li><a href="#-%E7%89%A9%E5%93%81%E6%B8%85%E9%99%A4%E5%99%A8dfc_itemcleaner-c%E7%BB%84%E4%BB%B6dfcitemcleaner">☑ 物品清除器(dfc_itemcleaner) C#组件(DfcItemCleaner)</a></li>
<li><a href="#-%E7%89%A9%E5%93%81%E7%94%9F%E6%88%90%E5%99%A8dfc_itembuilder-c%E7%BB%84%E4%BB%B6dfcitembuilder">☑ 物品生成器(dfc_itembuilder) C#组件(DfcItemBuilder)</a></li>
<li><a href="#-%E7%89%A9%E5%93%81%E6%89%B9%E5%A4%84%E7%90%86%E5%99%A8dfc_itembatch-c%E7%BB%84%E4%BB%B6dfcitembatch">☑ 物品批处理器(dfc_itembatch) C#组件(DfcItemBatch)</a></li>
<li><a href="#-%E8%A7%92%E8%89%B2%E5%93%8D%E5%BA%94%E5%99%A8dfc_characterresponder-c%E7%BB%84%E4%BB%B6dfccharacterresponder">☑ 角色响应器(dfc_characterresponder) C#组件(DfcCharacterResponder)</a></li>
<li><a href="#-%E5%8F%AF%E7%A9%BF%E6%88%B4%E7%89%A9%E6%9F%93%E8%89%B2%E8%84%9A%E6%9C%ACdfc_scriptwearabledyeing-c%E7%BB%84%E4%BB%B6dfcscriptwearabledyeing">☑ 可穿戴物染色脚本(dfc_scriptwearabledyeing) C#组件(DfcScriptWearableDyeing)</a></li>
<li><a href="#-wifi%E5%88%9D%E5%A7%8B%E5%8C%96%E8%84%9A%E6%9C%ACdfc_scriptwifiinitializer-c%E7%BB%84%E4%BB%B6dfcscriptwifiinitializer">☑ WIFI初始化脚本(dfc_scriptwifiinitializer) C#组件(DfcScriptWifiInitializer)</a></li>
<li><a href="#-%E6%BD%9C%E8%89%87%E4%BD%8D%E7%BD%AE%E9%94%81%E5%AE%9A%E8%84%9A%E6%9C%ACdfc_scriptsubmarinelocker-c%E7%BB%84%E4%BB%B6dfcscriptsubmarinelocker">☑ 潜艇位置锁定脚本(dfc_scriptsubmarinelocker) C#组件(DfcScriptSubmarineLocker)</a></li>
</ul>
</li>
<li><a href="#%E6%A8%A1%E7%BB%84%E4%BE%9D%E8%B5%96">模组依赖</a></li>
</ul>
</li>
</ul>
<hr>
<h3 id="简介">简介 </h3>
<p>派系工艺模组在渊深本体多人联机的沙盒模式中，以派系、职业、装备三元素作为基础，为玩家提供了丰富多样的自定义工具，以满足不同的地图需求。</p>
<ol>
<li><strong>派系</strong>：玩家可以选择加入不同的派系，每个派系都有其独特的背景故事、角色设定和玩法风格。例如，你可以加入守序的木卫二联盟，对社会的资源、制造与军力实施铁腕统治。或者加入木星分离主义分子，破坏木卫二联盟的正常运作，削弱其权威。</li>
<li><strong>职业</strong>：每个派系提供了多种职业供玩家选择，每种职业都有独特的技能和能力。</li>
<li><strong>装备</strong>：每个职业拥有一套独一无二、固有的或公共的装备体系，包括武器、防具、工具、药物和其他物资等，玩家可以根据场合上的情况选择不同装备进行应对。</li>
</ol>
<p>在派系工艺中，玩家可以自由地选择派系、职业和装备。然而，这些选项都存在三个共同的限制条件。只有在满足以下所有条件的情况下，玩家才能进行相应的选择。</p>
<ol>
<li><strong>剩余次数</strong> ＞ 0</li>
<li><strong>当前数量</strong> ＜ 数量上限</li>
<li><strong>比例(率)</strong> ＜ 比重</li>
</ol>
<p>这三个条件的<strong>主谓项</strong>（剩余次数、数量上限、当前数量、比例、比重）是根据它们的直接或间接的父级元素单独计算，派系限制条件的<strong>主谓项</strong>是根据所有的派系进行计算，而职业和装备的限制条件的<strong>主谓项</strong>是根据其所属的派系进行计算，<u>这么做的目的是为了让同一个职业、装备可以分别从属于不同的派系、职业，并且相互之间不产生冲突</u>。</p>
<hr>
<h3 id="重生系统">重生系统 </h3>
<p>如果使用dfc自定义了游戏模式，那么重生系统会被改写。只有在开启了 <code>允许复活</code> 选项后才生效，在重生倒计时结束后，玩家无法改变派系，但可以在之后的任意时间内再次重新选择职业和装备，这意味着你可以等待大部队一起重生。</p>
<hr>
<h3 id="初始化">初始化 </h3>
<h4 id="内部编辑器工具实现可选推荐">内部编辑器工具实现(可选,推荐) </h4>
<p>如果没有通过外部Lua脚本实例化 <code>dfc</code> 并对其初始化，那么会尝试解包地图.sub文件并查找是否存在 <strong><a href="#-%E5%88%9D%E5%A7%8B%E5%8C%96%E5%99%A8dfc_initializer-c%E7%BB%84%E4%BB%B6dfcinitializer">初始化器</a></strong>，如果存在，则使用第一个被找到的初始化器执行初始化操作。在 <code>PVPMap</code> 模组中有完整的实例，请查看 <code>派系工艺 COC模组测试 ZRG改</code>。</p>
<hr>
<h3 id="工具">工具 </h3>
<p>派系工艺为地图开发者们提供了一套丰富的自定义套件，它们可以用来方便地实现非常多原版完全无法做到的功能，<u>在潜艇编辑器内测试允许您实时修改这些工具的属性以进行调试，不过在多人联机下无法手动调整可编辑属性</u>，接下来会逐一介绍每种工具以及它们各自的用途与示例，你可以根据自身的需要查找对应的工具。</p>
<h4 id="-初始化器dfc_initializer-c组件dfcinitializer">☑ 初始化器(dfc_initializer) C#组件(DfcInitializer) </h4>
<p>如果没有使用外部Lua脚本初始化地图，那么将利用该初始化器执行初始化操作。该组件提供了部分属性来改写游戏模式的基本设置：</p>
<ol>
<li><strong>Allow Mid Round Join</strong>: 允许玩家中途加入游戏</li>
<li><strong>Allow Respawn</strong>: 允许复活</li>
</ol>
<h4 id="-新增出生区dfc_newspawnpointset-c组件dfcnewspawnpointset">☑ 新增出生区(dfc_newspawnpointset) C#组件(DfcNewSpawnPointSet) </h4>
<h4 id="-新增派系dfc_newfaction-c组件dfcnewfaction">☑ 新增派系(dfc_newfaction) C#组件(DfcNewFaction) </h4>
<h4 id="-新增职业dfc_newjob-c组件dfcnewjob">☑ 新增职业(dfc_newjob) C#组件(DfcNewJob) </h4>
<h4 id="-新增装备dfc_newgear-c组件dfcnewgear">☑ 新增装备(dfc_newgear) C#组件(DfcNewGear) </h4>
<h4 id="-允许派系重生dfc_allowrespawn-c组件dfcallowrespawn">☑ 允许派系重生(dfc_allowrespawn) C#组件(DfcAllowRespawn) </h4>
<p><code>signal_in</code> 接受到 <code>"0"</code> 时禁止指定派系重生，否则视为允许。</p>
<h4 id="-添加或移除职业dfc_addorremovejob-c组件dfcaddorremovejob">☑ 添加或移除职业(dfc_addorremovejob) C#组件(DfcAddOrRemoveJob) </h4>
<p><code>signal_in</code> 接受到 <code>"0"</code> 时移除指定派系中的指定职业，否则视为添加。<br>
使用 <code>,</code> 分隔符可以指定多个派系和职业。</p>
<h4 id="-添加或移除装备dfc_addorremovegear-c组件dfcaddorremovegear">☑ 添加或移除装备(dfc_addorremovegear) C#组件(DfcAddOrRemoveGear) </h4>
<p><code>signal_in</code> 接受到 <code>"0"</code> 时移除指定职业中的指定装备，否则视为添加。<br>
使用 <code>,</code> 分隔符可以指定多个职业和装备。</p>
<h4 id="-lua组件dfc_luacomponent-c组件dfcluacomponent">☑ Lua组件(dfc_luacomponent) C#组件(DfcLuaComponent) </h4>
<p>Ctrl+CV自<a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2937571024">RGzXTrauma</a>模组，并且优化和解决了编译错误。</p>
<h4 id="-lua组件2代dfc_lua2component-c组件dfclua2component">☑ Lua组件2代(dfc_lua2component) C#组件(DfcLua2Component) </h4>
<p>方案源自工坊模组MicroLua: <a href="https://steamcommunity.com/sharedfiles/filedetails/?id=3018125421">https://steamcommunity.com/sharedfiles/filedetails/?id=3018125421</a><br>
拥有32个并排IO，通过闭包上下文访问upvalues，减轻了性能负担，并撤除了环境约束。</p>
<h5 id="chunk块所在作用域包含的变量列表">Chunk块所在作用域包含的变量列表 </h5>
<ul>
<li><strong>out</strong>: 包装了lua组件的userdata，在代码中执行setindex操作，用于控制信号输出</li>
<li><strong>luaItem</strong>: lua组件本身，类型为Barotrauma.Item</li>
<li><strong>clear</strong>: 清空table的函数，原型fun(t: table)</li>
<li><strong>sync</strong>: 仅服务器可用，客户端忽略，用于向客户端发送并同步输出信号，该函数接受一个table作为参数，表域内，键为需要执行同步输出的引脚序号，值为信号值</li>
<li><strong>loaded</strong>: 函数，在地图加载完成后执行</li>
<li><strong>upd</strong>: 更新函数，会传递更新周期作为参数</li>
<li><strong>inp</strong>: 由用户在chunk中定义，用于访问输入的信号值，类型为table&lt;integer, string|number&gt;或fun(i: integer, v:string|number)</li>
<li><strong>sender</strong>: 使用out输出信号时设置的发送者</li>
<li><strong>senders</strong>: 用于访问相应引脚接收到的信号的发送者</li>
</ul>
<h5 id="示例一">示例一 </h5>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token comment">-- 定义inp（可为`nil`），勿使用local声明，因为符号`inp`的变量已被预先声明为局部变量，其类型为`table&lt;integer, string|number&gt;`；</span>
<span class="token comment">-- 在表域内，键为引脚序号（输入），值为对应引脚序号所接受到的信号值。</span>
inp <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>

<span class="token comment">-- 定义senders（可为`nil`），同上，勿使用local声明；</span>
senders <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>

<span class="token keyword keyword-local">local</span> 逝去时间 <span class="token operator">=</span> <span class="token number">0.0</span>

<span class="token comment">-- 定义upd（可为`nil`），同上，勿使用local声明；</span>
<span class="token comment">-- 在该组件更新时调用，参数`deltaTime`为更新周期</span>
<span class="token keyword keyword-function">function</span> <span class="token function">upd</span><span class="token punctuation">(</span>deltaTime<span class="token punctuation">)</span>
    逝去时间 <span class="token operator">=</span> 逝去时间 <span class="token operator">+</span> deltaTime

    <span class="token comment">-- 如果signal_in1引脚接受到信号</span>
    <span class="token keyword keyword-if">if</span> inp<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">~=</span> <span class="token keyword keyword-nil">nil</span> <span class="token keyword keyword-then">then</span>
        <span class="token comment">-- 设置信号发送者为signal_in1引脚接受到的信号的发送者</span>
        sender <span class="token operator">=</span> senders<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span>
        <span class="token comment">-- 从signal_out1引脚输出逝去时间，会立即输出该信号，而不是像1代的lua组件一样等到更新结束之后再输出</span>
        out<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> 逝去时间
        <span class="token comment">-- 服务器发起同步事件，在客户端接受到事件数据后，会从signal_out1输出逝去时间</span>
        <span class="token function">sync</span> <span class="token punctuation">{</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> 逝去时间 <span class="token punctuation">}</span>
        <span class="token comment">-- inp并不会被自动清除，需要手动清除inp[1]，sender和senders也一样</span>
        inp<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token keyword keyword-nil">nil</span>
        sender <span class="token operator">=</span> <span class="token keyword keyword-nil">nil</span>
        senders<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token keyword keyword-nil">nil</span>
    <span class="token keyword keyword-end">end</span>

    <span class="token comment">-- 如果signal_in2引脚接受到信号</span>
    <span class="token keyword keyword-if">if</span> inp<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span> <span class="token keyword keyword-then">then</span>
        <span class="token comment">-- 函数清空inp表和senders表</span>
        <span class="token function">clear</span><span class="token punctuation">(</span>inp<span class="token punctuation">)</span>
        <span class="token function">clear</span><span class="token punctuation">(</span>senders<span class="token punctuation">)</span>
        <span class="token comment">-- 时间复位</span>
        逝去时间 <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword keyword-end">end</span>
<span class="token keyword keyword-end">end</span>
</code></pre><h5 id="示例二">示例二 </h5>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token keyword keyword-local">local</span> 逝去时间 <span class="token operator">=</span> <span class="token number">0.0</span>

<span class="token comment">-- inp也可以被定义成原型为`fun(i, v)`的函数；</span>
<span class="token comment">-- 在接受到信号时回调，参数`i`为引脚序号（输入），`v`为对应引脚序号所接受到的信号值。</span>
<span class="token keyword keyword-function">function</span> <span class="token function">inp</span><span class="token punctuation">(</span>i<span class="token punctuation">,</span> v<span class="token punctuation">)</span>
    <span class="token keyword keyword-if">if</span> i <span class="token operator">==</span> <span class="token number">1</span> <span class="token keyword keyword-then">then</span>
        out<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> 逝去时间
    <span class="token keyword keyword-end">end</span>
    <span class="token keyword keyword-if">if</span> i <span class="token operator">==</span> <span class="token number">2</span> <span class="token keyword keyword-then">then</span>
        逝去时间 <span class="token operator">=</span> <span class="token number">0.0</span>
    <span class="token keyword keyword-end">end</span>
<span class="token keyword keyword-end">end</span>

<span class="token keyword keyword-function">function</span> <span class="token function">upd</span><span class="token punctuation">(</span>deltaTime<span class="token punctuation">)</span>
    逝去时间 <span class="token operator">=</span> 逝去时间 <span class="token operator">+</span> deltaTime
<span class="token keyword keyword-end">end</span>
</code></pre><h5 id="示例三">示例三 </h5>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token comment">-- 你也可以不用定义inp和upd，直接运行一段代码</span>
<span class="token function">print</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token string">"物品总数：%i"</span><span class="token punctuation">)</span><span class="token punctuation">:</span><span class="token function">format</span><span class="token punctuation">(</span><span class="token operator">#</span>Item<span class="token punctuation">.</span>ItemList<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token function">print</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token string">"Lua组件位置：%s"</span><span class="token punctuation">)</span><span class="token punctuation">:</span><span class="token function">format</span><span class="token punctuation">(</span><span class="token function">tostring</span><span class="token punctuation">(</span>luaItem<span class="token punctuation">.</span>WorldPosition<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token function">print</span><span class="token punctuation">(</span><span class="token string">"初始化完成！"</span><span class="token punctuation">)</span>
</code></pre><h5 id="示例四">示例四 </h5>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token comment">-- 定义loaded函数（可为`nil`），在地图加载完成后执行</span>
<span class="token keyword keyword-function">function</span> <span class="token function">loaded</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword keyword-local">local</span> 随机密码 <span class="token operator">=</span> math<span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    out<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> 随机密码
    <span class="token comment">-- sync可能无法在此时100%同步，可以用Lub.Wait延时一段时间再执行</span>
    Lub<span class="token punctuation">.</span><span class="token function">Wait</span> <span class="token punctuation">{</span> delay <span class="token operator">=</span> <span class="token number">3000</span><span class="token punctuation">,</span>
        <span class="token keyword keyword-function">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
            <span class="token keyword keyword-if">if</span> <span class="token keyword keyword-not">not</span> luaItem<span class="token punctuation">.</span>Removed <span class="token keyword keyword-then">then</span>
                <span class="token function">sync</span> <span class="token punctuation">{</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> 随机密码 <span class="token punctuation">}</span>
            <span class="token keyword keyword-end">end</span>
        <span class="token keyword keyword-end">end</span>
    <span class="token punctuation">}</span>
<span class="token keyword keyword-end">end</span>
</code></pre><h4 id="-传送点dfc_teleporter-c组件dfcteleporter">☑ 传送点(dfc_teleporter) C#组件(DfcTeleporter) </h4>
<p>与<a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2902757031">ZDoor</a>模组以及PVP服使用的传送门类似，交互时可以传送角色，须要接线才能使其运转，有所不同的是它没有实际的贴图，但可以调整其交互范围以及传送开关，通常可以摆放其他的装饰物作为该传送点的外观。<br>
当由某个角色产生的信号发送到了传送点的<strong>信号输入</strong>时，该角色将被传送至该传送点的位置。<br>
该组件拥有以下属性用于控制传送逻辑：</p>
<ol>
<li><strong>Disable Teleport Dragged Character</strong>: 禁止传送被拖拽的角色</li>
<li><strong>TeleportAble</strong>: 当值为假时，角色无法被传送至该点，可由信号设置</li>
<li><strong>Cooldown</strong>: 传送后需要等待的全局冷却时间，而非为每个角色单独计算冷却</li>
</ol>
<h4 id="-数据获取器dfc_datagetter-c组件dfcdatagetter">☑ 数据获取器(dfc_datagetter) C#组件(DfcDataGetter) </h4>
<p>它接受一个信号，并根据当前组件的索引 <code>DataIndex</code> 获取一个全局数据，如果获取的值为空，则会自动为其分配一个默认值 <code>DefaultData</code>，接线面板的各引脚说明：</p>
<ol>
<li><strong>get_data</strong>: 获取数据</li>
<li><strong>set_index</strong>: 设置索引</li>
<li><strong>signal_out</strong>: 输出数据值</li>
</ol>
<h4 id="-数据设置器dfc_datasetter-c组件dfcdatasetter">☑ 数据设置器(dfc_datasetter) C#组件(DfcDataSetter) </h4>
<p>它接受一个信号，并将其信号值存储至当前组件的索引 <code>DataIndex</code> 中，接线面板的各引脚说明：</p>
<ol>
<li><strong>set_data</strong>: 设置数据值</li>
<li><strong>set_index</strong>: 设置索引</li>
</ol>
<h4 id="-包含区域dfc_regionincluded">☑ 包含区域(dfc_regionincluded) </h4>
<h4 id="-不包含区域dfc_regionexcluded">☑ 不包含区域(dfc_regionexcluded) </h4>
<h4 id="-角色检测器dfc_characterchecker-c组件dfccharacterchecker">☑ 角色检测器(dfc_characterchecker) C#组件(DfcCharacterChecker) </h4>
<p>通过链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 或 <strong><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">不包含区域</a></strong> 组成区域，在接收到信号后，会输出该区域内匹配条件的角色总数。<br>
该组件拥有以下属性用于修改角色的匹配条件：</p>
<ol>
<li><strong>Minimum Velocity</strong>: 最小速度</li>
<li><strong>Character Target Type</strong>: 角色类型</li>
<li><strong>Character Species Names</strong>: 角色种名</li>
<li><strong>Character Group</strong>: 角色组别</li>
<li><strong>Character Tags</strong>: 角色标记</li>
</ol>
<h4 id="-角色检查器单个dfc_charactersinglechecker-c组件dfccharactersinglechecker">☑ 角色检查器(单个)(dfc_charactersinglechecker) C#组件(DfcCharacterSingleChecker) </h4>
<p>接受一个由角色发出的信号，如果该角色匹配相应条件，将以该角色作为源将该<strong>信号值</strong>、<strong>角色GUID</strong>、<strong>角色名称</strong>、<strong>角色种名</strong>、<strong>角色组别</strong>、<strong>角色标记</strong>分别发送，通过以下属性修改角色的匹配条件：</p>
<ol>
<li><strong>Character Team Type</strong>: 角色类型</li>
<li><strong>Character Species Names</strong>: 角色种名</li>
<li><strong>Character Group</strong>: 角色组别</li>
<li><strong>Character Tags</strong>: 角色标记</li>
</ol>
<h4 id="-动作-结束游戏dfc_actionendgame-c组件dfcactionendgame">☑ 动作† 结束游戏(dfc_actionendgame) C#组件(DfcActionEndGame) </h4>
<p>在接收到信号以后结束本次巡回。</p>
<h4 id="-动作-发送聊天消息dfc_actionsendchatmessage-c组件dfcactionsendchatmessage">☑ 动作† 发送聊天消息(dfc_actionsendchatmessage) C#组件(DfcActionSendChatMessage) </h4>
<p>在接收到信号后向玩家发送消息，通过设置属性来过滤出可收到消息的玩家：</p>
<ol>
<li><strong>Sender Receiver Relation</strong>: 发送者(信号来源)必须存在且与接收者的必须关系，<code>无</code>则忽略
<ul>
<li>无</li>
<li>不同队伍</li>
<li>相同队伍</li>
</ul>
</li>
<li><strong>Sender Target Type</strong>: 发送者类型</li>
<li><strong>Sender Species Names</strong>: 发送者种名</li>
<li><strong>Sender Group</strong>: 发送者组别</li>
<li><strong>Sender Tags</strong>: 发送者标记</li>
<li><strong>Receiver Target Type</strong>: 接受者类型</li>
<li><strong>Receiver Species Names</strong>: 接受者种名</li>
<li><strong>Receiver Group</strong>: 接受者组别</li>
<li><strong>Receiver Tags</strong>: 接受者标记</li>
<li><strong>Spectator Receivable</strong>: 发送给观众席</li>
<li><strong>Spectator Only Receivable</strong>: 发送给仅观看的玩家</li>
</ol>
<h4 id="-事件-进出区域dfc_evententerleaveregion-c组件dfcevententerleaveregion">☑ 事件☇ 进出区域(dfc_evententerleaveregion) C#组件(DfcEventEnterLeaveRegion) </h4>
<p>通过链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 或 <strong><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">不包含区域</a></strong> 组成区域，当有角色进入或离开该区域后，会以该角色作为源并发送五个信号，分别为<strong>角色GUID(Globally Unique Identifier: 全局唯一标识符, 用于唯一标识某个实体的256位字符串)</strong>、<strong>角色名称</strong>、<strong>角色种名</strong>、<strong>角色标记</strong>、<strong>“0”或“1”(“0”表示离开，“1”表示进入)</strong>。<br>
该组件拥有以下属性用于控制事件触发的条件：</p>
<ol>
<li><strong>Minimum Velocity</strong>: 最小速度</li>
<li><strong>Character Target Type</strong>: 角色类型</li>
<li><strong>Character Species Names</strong>: 角色种名</li>
<li><strong>Character Group</strong>: 角色组别</li>
<li><strong>Character Tags</strong>: 角色标记</li>
<li><strong>Match After Leave</strong>: 在角色离开时须匹配2-5属性，否则无法触发事件</li>
</ol>
<h4 id="-事件-死亡dfc_eventcharacterdeath-c组件dfceventcharacterdeath">☑ 事件☇ 死亡(dfc_eventcharacterdeath) C#组件(DfcEventCharacterDeath) </h4>
<p>当有角色死亡时，会以该角色作为源并发送十个信号，分别为<strong>死者GUID</strong>、<strong>死者名称</strong>、<strong>死者种名</strong>、<strong>死者组别</strong>、<strong>死者标记</strong>、<strong>凶手GUID</strong>、<strong>凶手名称</strong>、<strong>凶手种名</strong>、<strong>凶手组别</strong>、<strong>凶手标记</strong>，1-5的信号源为死者，6-10的信号源为凶手。<br>
该组件拥有以下属性用于控制事件触发的条件：</p>
<ol>
<li><strong>Death Target Type</strong>: 死者类型</li>
<li><strong>Death Species Names</strong>: 死者种名</li>
<li><strong>Death Group</strong>: 死者组别</li>
<li><strong>Death Tags</strong>: 死者标记</li>
<li><strong>Killer Target Type</strong>: 凶手类型</li>
<li><strong>Killer Species Names</strong>: 凶手种名</li>
<li><strong>Killer Group</strong>: 凶手组别</li>
<li><strong>Killer Tags</strong>: 凶手标记</li>
</ol>
<h4 id="-角色清除器dfc_charactercleaner-c组件dfccharactercleaner">☑ 角色清除器(dfc_charactercleaner) C#组件(DfcCharacterCleaner) </h4>
<p>在引脚<strong>signal_in</strong>接收到信号后，会对其搜索到的所有待清除角色记录一次，如果目标的记录次数达到了给定次数，则将其清除，适当地合理使用可以缓解游戏不必要的卡顿，可以链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 和 <strong><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">不包含区域</a></strong> 以用于约束角色的搜索范围。。</p>
<ul>
<li><strong>属性</strong>
<ol>
<li><strong>Tolerance Threshold 清除阈值</strong><br>
角色记录次数达到该阈值时将被清除</li>
<li><strong>Character Target Type</strong>: 角色类型</li>
<li><strong>Character Species Names</strong>: 角色种名</li>
<li><strong>Character Group</strong>: 角色组别</li>
<li><strong>Character Tags</strong>: 角色标记</li>
</ol>
</li>
</ul>
<h4 id="-物品清除器dfc_itemcleaner-c组件dfcitemcleaner">☑ 物品清除器(dfc_itemcleaner) C#组件(DfcItemCleaner) </h4>
<ul>
<li><strong>用途</strong><br>
在引脚<strong>signal_in</strong>接收到信号后，会对其搜索到的所有待清除物品记录一次，如果物品的记录次数达到了给定次数，则将其清除，适当地合理使用可以缓解游戏不必要的卡顿。</li>
<li><strong>属性</strong>
<ul>
<li><strong>Tolerance Threshold 清除阈值</strong><br>
物品记录次数达到该阈值时将被清除</li>
<li><strong>Clean Rule 清除规则</strong><br>
构建一个清除规则的表达式需要定义至少一个标签组，以逗号<code>,</code>作为分隔符可以添加多个标签组，在标签组内也可以使用竖线 <code>|</code> 定义一个组内标签，当物品的<strong>标签Tags</strong>或<strong>标识符identifier</strong>匹配了其中一个标签组的所有组内标签时，则会被记录一次。<br>
清除规则分为<strong>弱清除</strong>与<strong>强清除</strong>，并继而分为<strong>包含</strong>与<strong>不包含</strong>，弱清除是指只有当物品不在容器内才会被记录，而强清除无视该条件。包含是指待清除物品须要匹配对应规则，而不包含要求不匹配。
<ul>
<li><strong>Weak Clean Pattern Includes 弱清除包含</strong></li>
<li><strong>Weak Clean Pattern Excludes 弱清除不包含</strong></li>
<li><strong>Strong Clean Pattern Includes 强清除包含</strong></li>
<li><strong>Strong Clean Pattern Excludes 强清除不包含</strong></li>
</ul>
</li>
<li><strong>Only Indoor 仅清除其所在潜艇上的物品</strong></li>
<li><strong>Ignore Static Body 忽略静态物品(导航终端,引擎,接线盒……)</strong></li>
<li><strong>Ignore Attached 忽略安装在了墙壁上的物品</strong></li>
<li><strong>Ignore Initial 忽略在巡回开始时加载的物品</strong></li>
</ul>
</li>
<li><strong>链接</strong><br>
可以链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 和 <strong><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">不包含区域</a></strong> 以用于约束物品的搜索范围。</li>
<li><strong>示例</strong><br>
下方的代码为该组件在保存之后于XML文本中的表示<pre data-role="codeBlock" data-info="xml" class="language-xml xml"><code><span class="token comment">&lt;!-- 弱清除带有 medical 或 weapon 标签的物品 --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>DfcItemCleaner</span>
  <span class="token attr-name">WeakCleanIncludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>medical,weapon<span class="token punctuation">"</span></span>
<span class="token punctuation">/&gt;</span></span>
<span class="token comment">&lt;!-- 弱清除带有 medical 或 weapon 标签的物品，但不包含吗啡或步枪 --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>DfcItemCleaner</span>
  <span class="token attr-name">WeakCleanIncludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>medical,weapon<span class="token punctuation">"</span></span>
  <span class="token attr-name">WeakCleanExcludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>antidama1,rifle<span class="token punctuation">"</span></span>
<span class="token punctuation">/&gt;</span></span>
<span class="token comment">&lt;!-- 弱清除带有 smallitem＋weapon 标签的物品 --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>DfcItemCleaner</span>
  <span class="token attr-name">WeakCleanIncludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>smallitem|weapon<span class="token punctuation">"</span></span>
<span class="token punctuation">/&gt;</span></span>
<span class="token comment">&lt;!-- 弱清除带有 smallitem＋weapon 标签的物品，但不包含机关手枪 --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>DfcItemCleaner</span>
  <span class="token attr-name">WeakCleanIncludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>smallitem|weapon<span class="token punctuation">"</span></span>
  <span class="token attr-name">WeakCleanExcludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>machinepistol<span class="token punctuation">"</span></span>
<span class="token punctuation">/&gt;</span></span>
<span class="token comment">&lt;!-- 弱清除带有 smallitem＋weapon 或 mediumitem＋weapon 标签的物品 --&gt;</span>
<span class="token comment">&lt;!-- 但不包含机关手枪或突击步枪 --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>DfcItemCleaner</span>
  <span class="token attr-name">WeakCleanIncludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>smallitem|weapon,mediumitem|weapon<span class="token punctuation">"</span></span>
  <span class="token attr-name">WeakCleanExcludes</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>machinepistol,assaultrifle<span class="token punctuation">"</span></span>
<span class="token punctuation">/&gt;</span></span>
</code></pre></li>
</ul>
<h4 id="-物品生成器dfc_itembuilder-c组件dfcitembuilder">☑ 物品生成器(dfc_itembuilder) C#组件(DfcItemBuilder) </h4>
<p>属性<strong>Item Builds 物品构建集</strong>存储了一个lua脚本的<code>{}</code>，是<strong>Item Builder Block 物品生成块</strong>的数组，用于描述物品生成信息，该组件在接受到信号之后，会查找该信号的发送者，如若找到发送信号的角色，则将物品生成在角色身上，否则生成在该物品生成器所在的位置，通过链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 可以改变物品生成的位置。</p>
<p>该组件拥有以下属性用于控制生成逻辑：</p>
<ol>
<li><strong>Item Builds</strong>: 存储一个Lua脚本<code>{}</code>类型的值，用以描述物品生成信息</li>
<li><strong>Can Spawn</strong>: 是否可以生成</li>
<li><strong>Amount</strong>: 限定生成的次数</li>
<li><strong>Force Spawn At Positions</strong>: 强制生成在即将被确定的某个位置，而不是角色身上</li>
<li><strong>Required Sender</strong>: 要求发送者存在</li>
<li><strong>Sender Target Type</strong>: 发送者类型</li>
<li><strong>Sender Species Names</strong>: 发送者种名</li>
<li><strong>Sender Group</strong>: 发送者组别</li>
<li><strong>Sender Tags</strong>: 发送者标记</li>
<li><strong>Group</strong>: 该值相同的物品生成器会被分到同一组，如果角色触发过<strong>Group</strong>组内的某个物品生成器，则无法生成，如果该属性值为空，则无限制。</li>
<li><strong>Identifier</strong>: 标识符，暂时没有任何用途</li>
</ol>
<p><strong>Item Builds</strong>的定义示例如下：</p>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token keyword keyword-return">return</span> <span class="token punctuation">{</span>
    <span class="token string">"这只是一个用于调试的名称"</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        <span class="token comment">-- 生成一个自注射耳机(identifier: autoinjectorheadset)</span>
        identifier <span class="token operator">=</span> <span class="token string">"autoinjectorheadset"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 执行装备操作(equip: true)</span>
        equip <span class="token operator">=</span> <span class="token keyword keyword-true">true</span><span class="token punctuation">,</span>
        <span class="token comment">-- 继承角色的耳机wifi通道(inheritchannel: true)</span>
        inheritchannel <span class="token operator">=</span> <span class="token keyword keyword-true">true</span><span class="token punctuation">,</span>
        <span class="token comment">-- 在自注射耳机内生成c4炸弹</span>
        <span class="token comment">-- 但物品标签须修改为"chem,medical"</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"c4block"</span><span class="token punctuation">,</span> tags <span class="token operator">=</span> <span class="token string">"chem,medical"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        <span class="token comment">-- 生成战地医疗服(identifier: doctorsuniform1)</span>
        identifier <span class="token operator">=</span> <span class="token string">"doctorsuniform1"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 执行装备操作(equip: true)</span>
        equip <span class="token operator">=</span> <span class="token keyword keyword-true">true</span><span class="token punctuation">,</span>
        <span class="token comment">-- 在战地医疗服内生成3种药物</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 生成1组绷带(8个)</span>
            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"antibleeding1"</span><span class="token punctuation">,</span> stacks <span class="token operator">=</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token comment">-- 生成2袋生理盐水</span>
            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"antibloodloss2"</span><span class="token punctuation">,</span> amount <span class="token operator">=</span> <span class="token number">2</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token comment">-- 在剩余的容器空间中填满吗啡</span>
            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"antidama1"</span><span class="token punctuation">,</span> fillinventory <span class="token operator">=</span> <span class="token keyword keyword-true">true</span> <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        <span class="token comment">-- 生成一个声纳信标</span>
        identifier <span class="token operator">=</span> <span class="token string">"sonarbeacon"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 放置在17号槽位，对应人类物品栏内的最后一个槽位</span>
        slotindex <span class="token operator">=</span> <span class="token number">17</span><span class="token punctuation">,</span>
        <span class="token comment">-- 设置声纳信标属性</span>
        properties <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 设置声纳信标为不可交互的</span>
            noninteractable <span class="token operator">=</span> <span class="token keyword keyword-true">true</span><span class="token punctuation">,</span>
            <span class="token comment">-- 设置CustomInterface组件的ElementStates属性，将可编辑的第一个条目(开启信标)设置为真</span>
            <span class="token punctuation">[</span><span class="token punctuation">{</span> <span class="token string">"custominterface"</span><span class="token punctuation">,</span> <span class="token string">"elementstates"</span> <span class="token punctuation">}</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">"true,"</span><span class="token punctuation">,</span>
            <span class="token comment">-- 设置CustomInterface组件的Signals属性，将可编辑的第二个条目(声纳信号)设置为“我在这里~”</span>
            <span class="token punctuation">[</span><span class="token punctuation">{</span> <span class="token string">"custominterface"</span><span class="token punctuation">,</span> <span class="token string">"signals"</span> <span class="token punctuation">}</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token string">";我在这里~"</span><span class="token punctuation">,</span>
            <span class="token comment">-- 推荐这样设置：</span>
            custominterface <span class="token operator">=</span> <span class="token punctuation">{</span>
                elementstates <span class="token operator">=</span> <span class="token string">"true,"</span><span class="token punctuation">,</span>
                signals <span class="token operator">=</span> <span class="token string">";我在这里~"</span><span class="token punctuation">,</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token comment">-- 因为CustomInterface的属性无法像其他组件的属性一样直接同步给客户端</span>
        <span class="token comment">-- 所以须要创建一个CustomInterface的ServerEvent事件来实现同步</span>
        <span class="token comment">-- 提示：并非所有组件的属性都可以通过创建ServerEvent事件来同步，具体问题需通过分析游戏源代码来解决</span>
        serverevents <span class="token operator">=</span> <span class="token string">"custominterface"</span><span class="token punctuation">,</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token punctuation">{</span>
                <span class="token comment">-- 生成一颗电池</span>
                identifier <span class="token operator">=</span> <span class="token string">"batterycell"</span><span class="token punctuation">,</span>
                <span class="token comment">-- 电池改为不可破坏(无限能源)</span>
                properties <span class="token operator">=</span> <span class="token punctuation">{</span> indestructible <span class="token operator">=</span> <span class="token keyword keyword-true">true</span> <span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        identifier <span class="token operator">=</span> <span class="token string">"boardingaxe"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 物品生成后的回调函数</span>
        onspawned <span class="token operator">=</span> <span class="token keyword keyword-function">function</span><span class="token punctuation">(</span>item<span class="token punctuation">)</span>
            <span class="token comment">-- 生成登船斧(identifier: boardingaxe)之后在控制台输出其名称</span>
            <span class="token function">print</span><span class="token punctuation">(</span>item<span class="token punctuation">.</span>Name<span class="token punctuation">)</span>
            <span class="token comment">-- 登船斧缩放改成0.75，精灵和图标为红色，近战攻击间隔0.5s</span>
            Lub<span class="token punctuation">.</span><span class="token function">SPEdit</span> <span class="token punctuation">{</span>
                scale <span class="token operator">=</span> <span class="token number">0.75</span><span class="token punctuation">,</span>
                spritecolor <span class="token operator">=</span> <span class="token string">"255,0,0"</span><span class="token punctuation">,</span>
                inventoryiconcolor <span class="token operator">=</span> <span class="token string">"255,0,0"</span><span class="token punctuation">,</span>
                meleeweapon <span class="token operator">=</span> <span class="token punctuation">{</span>
                    reload <span class="token operator">=</span> <span class="token number">0.5</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token punctuation">:</span><span class="token function">apply</span><span class="token punctuation">(</span>item<span class="token punctuation">)</span>
        <span class="token keyword keyword-end">end</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        identifier <span class="token operator">=</span> <span class="token string">"door"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 生成一扇手动门, 并放置和固定在潜艇上(install: true)</span>
        install <span class="token operator">=</span> <span class="token keyword keyword-true">true</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">-- 随机调用3次(amount: 3)物品池并(pool)生成手榴弹</span>
    <span class="token punctuation">{</span>
        amount <span class="token operator">=</span> <span class="token number">3</span><span class="token punctuation">,</span>
        <span class="token comment">-- 25%几率(10/40)生成燃素、震撼、破片手榴弹其中一个</span>
        <span class="token comment">-- 12.5%几率(5/40)生成EMP、酸液手榴弹其中一个</span>
        pool <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 比重(weight)为10，表示在该物品池中的权重，影响其被抽中的几率</span>
            <span class="token punctuation">{</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"fraggrenade"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"stungrenade"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"incendiumgrenade"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span> <span class="token number">5</span><span class="token punctuation">,</span>  <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"empgrenade"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token punctuation">{</span> <span class="token number">5</span><span class="token punctuation">,</span>  <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"chemgrenade"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">-- 抽卡, 50%概率: 一个存放了雷管(大师级c4炸弹或脏弹)的工具箱</span>
    <span class="token punctuation">{</span>
        pool <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token punctuation">{</span>
                <span class="token number">50</span><span class="token punctuation">,</span>
                <span class="token punctuation">{</span>
                    <span class="token punctuation">{</span>
                        identifier <span class="token operator">=</span> <span class="token string">"toolbox"</span><span class="token punctuation">,</span>
                        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
                            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"screwdriver"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
                            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"wrench"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
                            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"bluewire"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
                            <span class="token punctuation">{</span>
                                identifier <span class="token operator">=</span> <span class="token string">"detonator"</span><span class="token punctuation">,</span>
                                inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
                                    pool <span class="token operator">=</span> <span class="token punctuation">{</span>
                                        <span class="token punctuation">{</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"c4block"</span><span class="token punctuation">,</span> quality <span class="token operator">=</span> <span class="token number">3</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
                                        <span class="token punctuation">{</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"dirtybomb"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
                                    <span class="token punctuation">}</span>
                                <span class="token punctuation">}</span>
                            <span class="token punctuation">}</span><span class="token punctuation">,</span>
                            <span class="token punctuation">{</span> identifier <span class="token operator">=</span> <span class="token string">"button"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
                        <span class="token punctuation">}</span>
                    <span class="token punctuation">}</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token comment">-- 50%概率什么也没有</span>
            <span class="token punctuation">{</span>
                <span class="token number">50</span><span class="token punctuation">,</span>
                <span class="token punctuation">{</span><span class="token punctuation">}</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre><h4 id="-物品批处理器dfc_itembatch-c组件dfcitembatch">☑ 物品批处理器(dfc_itembatch) C#组件(DfcItemBatch) </h4>
<p>属性<strong>Item Batch Unit 批处理单元</strong>存储了一个lua脚本的<code>{}</code>，是<strong>Item Batch Block 批处理块</strong>的数组，用于描述物品批处理过程，该组件在接受到信号之后，会对其链接(link)的所有物品进行批处理，除此之外还会查找该信号的发送者，如若找到发送信号的角色，则也会对角色身上的物品进行批处理。</p>
<p>该组件拥有以下属性用于控制批处理逻辑：</p>
<ol>
<li><strong>Item Batch Unit</strong>: 存储一个Lua脚本<code>{}</code>类型的值，用以描述物品批处理过程</li>
<li><strong>Can Batch</strong>: 是否可以进行批处理</li>
<li><strong>Only Batch Linked To</strong>: 仅对链接的物品进行批处理</li>
<li><strong>Amount</strong>: 限定批处理的次数</li>
<li><strong>Required Sender</strong>: 要求发送者存在</li>
<li><strong>Sender Target Type</strong>: 发送者类型</li>
<li><strong>Sender Species Names</strong>: 发送者种名</li>
<li><strong>Sender Group</strong>: 发送者组别</li>
<li><strong>Sender Tags</strong>: 发送者标记</li>
<li><strong>Group</strong>: 该值相同的物品批处理器会被分到同一组，如果角色触发过<strong>Group</strong>组内的某个物品批处理器，则无法生成，如果该属性值为空，则无限制。</li>
<li><strong>Identifier</strong>: 标识符，暂时没有任何用途</li>
</ol>
<p><strong>Item Batch Unit</strong>的定义示例如下：</p>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token keyword keyword-return">return</span> <span class="token punctuation">{</span>
    <span class="token string">"这只是一个用于调试的名称"</span><span class="token punctuation">,</span>
    <span class="token comment">-- 丢弃掉耳机容器内的非注射型药物</span>
    <span class="token punctuation">{</span>
        <span class="token comment">-- 添加匹配条件: 要求物品须要在耳机槽位上，支持用数组表示</span>
        <span class="token comment">-- 例如 slottype = { InvSlotType.Headset, InvSlotType.Any }，表示匹配耳机槽位和非装备型槽位(Any)</span>
        slottype <span class="token operator">=</span> InvSlotType<span class="token punctuation">.</span>Headset<span class="token punctuation">,</span>
        <span class="token comment">-- 匹配成功后，对匹配的物品其容器内的子物品进行批处理</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 添加匹配条件: 没有syringe标签</span>
            excludedtags <span class="token operator">=</span> <span class="token string">"syringe"</span><span class="token punctuation">,</span>
            <span class="token comment">-- 匹配成功后，丢弃掉匹配的物品</span>
            drop <span class="token operator">=</span> <span class="token keyword keyword-true">true</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        <span class="token comment">-- 添加匹配条件: 是战地医疗服(doctorsuniform1)，支持用数组表示</span>
        <span class="token comment">-- 例如 identifiers = { "doctorsuniform1", "doctorsuniform2" }, 表示战地医疗服或医生制服</span>
        identifiers <span class="token operator">=</span> <span class="token string">"doctorsuniform1"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 添加匹配条件: 要求物品是被装备或穿戴的</span>
        equipped <span class="token operator">=</span> <span class="token keyword keyword-true">true</span><span class="token punctuation">,</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 丢弃掉战地医疗服里的绷带</span>
            <span class="token punctuation">{</span> identifiers <span class="token operator">=</span> <span class="token string">"antibleeding1"</span><span class="token punctuation">,</span> drop <span class="token operator">=</span> <span class="token keyword keyword-true">true</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token comment">-- 移除掉生理盐水</span>
            <span class="token punctuation">{</span> identifiers <span class="token operator">=</span> <span class="token string">"antibloodloss2"</span><span class="token punctuation">,</span> remove <span class="token operator">=</span> <span class="token keyword keyword-true">true</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token comment">-- 匹配具有medical标签的物品，并将其图标颜色改为"0,0,0"(黑色)</span>
            <span class="token punctuation">{</span> tags <span class="token operator">=</span> <span class="token string">"medical"</span><span class="token punctuation">,</span> properties <span class="token operator">=</span> <span class="token punctuation">{</span> inventoryiconcolor <span class="token operator">=</span> <span class="token string">"0,0,0"</span> <span class="token punctuation">}</span> <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">{</span>
        <span class="token comment">-- 添加匹配条件: 是声纳信标(sonarbeacon)</span>
        identifiers <span class="token operator">=</span> <span class="token string">"sonarbeacon"</span><span class="token punctuation">,</span>
        <span class="token comment">-- 添加匹配条件: 在17号槽位上，对应人类物品栏内的最后一个槽位，支持用数组表示</span>
        <span class="token comment">-- 例如 slotindex = { 16, 17 }, 表示人类物品栏内的倒数两个槽位</span>
        slotindex <span class="token operator">=</span> <span class="token number">17</span><span class="token punctuation">,</span>
        properties <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 改为可交互的</span>
            noninteractable <span class="token operator">=</span> <span class="token keyword keyword-false">false</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            <span class="token comment">-- 将容器内的物品(电池)改为可破坏的</span>
            properties <span class="token operator">=</span> <span class="token punctuation">{</span> indestructible <span class="token operator">=</span> <span class="token keyword keyword-false">false</span> <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">-- 把电棍的大小放大5倍</span>
    <span class="token punctuation">{</span>
        identifiers <span class="token operator">=</span> <span class="token string">"stungrenade"</span><span class="token punctuation">,</span>
        properties <span class="token operator">=</span> <span class="token punctuation">{</span> scale <span class="token operator">=</span> <span class="token number">5</span> <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">-- 丢弃掉工具箱-&gt;雷管内的物品</span>
    <span class="token punctuation">{</span>
        identifiers <span class="token operator">=</span> <span class="token string">"toolbox"</span><span class="token punctuation">,</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
            identifiers <span class="token operator">=</span> <span class="token string">"detonator"</span><span class="token punctuation">,</span>
            inventory <span class="token operator">=</span> <span class="token punctuation">{</span>
                drop <span class="token operator">=</span> <span class="token keyword keyword-true">true</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">-- 移除品质为2的左轮手枪, quality对物品的品质进行匹配，也支持数组</span>
    <span class="token punctuation">{</span>
        identifier <span class="token operator">=</span> <span class="token string">"revolver"</span><span class="token punctuation">,</span>
        quality <span class="token operator">=</span> <span class="token number">2</span><span class="token punctuation">,</span>
        inventory <span class="token operator">=</span> <span class="token punctuation">{</span> remove <span class="token operator">=</span> <span class="token keyword keyword-true">true</span> <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token comment">-- 移除所有物品</span>
    <span class="token comment">-- { remove = true },</span>
    <span class="token comment">-- 移除物品栏内非装备槽位的所有物品</span>
    <span class="token comment">-- { slottype = InvSlotType.Any, remove = true },</span>
<span class="token punctuation">}</span>
</code></pre><h4 id="-角色响应器dfc_characterresponder-c组件dfccharacterresponder">☑ 角色响应器(dfc_characterresponder) C#组件(DfcCharacterResponder) </h4>
<p>属性<strong>Chunk 应答回调</strong>存储了一个lua脚本的编程块(chunk/block)，该组件在接受到信号之后，如若查找到发送该信号的角色，则会对该角色执行脚本函数，使用示例如下：</p>
<pre data-role="codeBlock" data-info="lua" class="language-lua lua"><code><span class="token keyword keyword-return">return</span> <span class="token keyword keyword-function">function</span><span class="token punctuation">(</span>character<span class="token punctuation">)</span>
    <span class="token comment">-- 给予角色狂战士天赋</span>
    character<span class="token punctuation">.</span><span class="token function">GiveTalent</span><span class="token punctuation">(</span><span class="token string">"berserker"</span><span class="token punctuation">)</span>
    <span class="token comment">-- 武器技能提高40</span>
    character<span class="token punctuation">.</span>Info<span class="token punctuation">.</span><span class="token function">IncreaseSkillLevel</span><span class="token punctuation">(</span><span class="token string">"weapons"</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">)</span>
    <span class="token comment">-- 医疗技能设置为100</span>
    character<span class="token punctuation">.</span>Info<span class="token punctuation">.</span><span class="token function">SetSkillLevel</span><span class="token punctuation">(</span><span class="token string">"medical"</span><span class="token punctuation">,</span> <span class="token number">100</span><span class="token punctuation">)</span>

    <span class="token comment">-- 在角色的主肢体上施加1点画皮共生(husksymbiosis)</span>
    character<span class="token punctuation">.</span>CharacterHealth<span class="token punctuation">.</span><span class="token function">ApplyAffliction</span><span class="token punctuation">(</span>
        character<span class="token punctuation">.</span>AnimController<span class="token punctuation">.</span>MainLimb<span class="token punctuation">,</span>
        AfflictionPrefab<span class="token punctuation">.</span>Prefabs<span class="token punctuation">[</span><span class="token function">Identifier</span><span class="token punctuation">(</span><span class="token string">"husksymbiosis"</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">Instantiate</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token keyword keyword-end">end</span>
</code></pre><p>支持通过链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 或 <strong><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">不包含区域</a></strong> 组成区域，并将脚本函数应用于该区域内所有通过匹配的角色。<br>
通过以下属性修改角色的响应条件：</p>
<ol>
<li><strong>Can Response</strong>: 是否可以响应</li>
<li><strong>Apply To Sender</strong>: 是否应用于发送者</li>
<li><strong>Character Team Type</strong>: 角色类型</li>
<li><strong>Character Species Names</strong>: 角色种名</li>
<li><strong>Character Group</strong>: 发送者组别</li>
<li><strong>Character Tags</strong>: 发送者标记</li>
<li><strong>Group</strong>: 该值相同的角色响应器会被分到同一组，如果角色被<strong>Group</strong>组内的某个角色响应器应用过脚本函数，则无法再次响应，如果该属性值为空，则无限制。</li>
<li><strong>Identifier</strong>: 标识符，暂时没有任何用途</li>
</ol>
<h4 id="-可穿戴物染色脚本dfc_scriptwearabledyeing-c组件dfcscriptwearabledyeing">☑ 可穿戴物染色脚本(dfc_scriptwearabledyeing) C#组件(DfcScriptWearableDyeing) </h4>
<p>当角色穿戴物品时，可以改变该物品的颜色。<br>
该组件拥有以下属性用于修改染色条件：</p>
<ol>
<li><strong>Sprite Color</strong>: 贴图颜色</li>
<li><strong>Inventory Icon Color</strong>: 图标颜色</li>
<li><strong>Wearer Target Type</strong>: 穿戴者类型</li>
<li><strong>Wearer Species Names</strong>: 穿戴者种名</li>
<li><strong>Wearer Group</strong>: 穿戴者组别</li>
<li><strong>Wearer Tags</strong>: 穿戴者标记</li>
<li><strong>Matcher Pattern  Includes</strong> 要求物品拥有指定标识符或标签，其表达式规则与 <a href="#-%E7%89%A9%E5%93%81%E6%B8%85%E9%99%A4%E5%99%A8dfc_itemcleaner-c%E7%BB%84%E4%BB%B6dfcitemcleaner">物品清除器</a> 的相同</li>
<li><strong>Matcher Pattern Excludes</strong> 要求物品没有指定标识符或标签</li>
<li><strong>InvSlotType</strong> 允许的槽位类型</li>
</ol>
<h4 id="-wifi初始化脚本dfc_scriptwifiinitializer-c组件dfcscriptwifiinitializer">☑ WIFI初始化脚本(dfc_scriptwifiinitializer) C#组件(DfcScriptWifiInitializer) </h4>
<p>当任何带有wifi组件的物品被创建后，可以改变其wifi频道和所属队伍，通过链接(link) <strong><a href="#-%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionincluded">包含区域</a></strong> 或 <strong><a href="#-%E4%B8%8D%E5%8C%85%E5%90%AB%E5%8C%BA%E5%9F%9Fdfc_regionexcluded">不包含区域</a></strong> 用于匹配物品生成的位置，也支持通过与 <a href="#-%E7%89%A9%E5%93%81%E6%B8%85%E9%99%A4%E5%99%A8dfc_itemcleaner-c%E7%BB%84%E4%BB%B6dfcitemcleaner">物品清除器</a> 相同的表达式规则限制物品的标识符和标签。<br>
该脚本组件部分属性说明：</p>
<ol>
<li><strong>Wifi Channel Range</strong> 一个数值范围，用于将wifi组件的通道设置为其范围内的一个随机数</li>
<li><strong>Always Calculate Random Channel</strong> 是否始终计算随机通道？值为 <code>真</code> 时wifi组件的通道始终由 <code>Wifi Channel Range</code> 随机确定，否则只会被设置为第一次计算出来的随机数。</li>
<li><strong>TeamID</strong> 修改wifi的所属队伍</li>
</ol>
<h4 id="-潜艇位置锁定脚本dfc_scriptsubmarinelocker-c组件dfcscriptsubmarinelocker">☑ 潜艇位置锁定脚本(dfc_scriptsubmarinelocker) C#组件(DfcScriptSubmarineLocker) </h4>
<hr>
<h3 id="模组依赖">模组依赖 </h3>
<ul>
<li><strong>Lua For Barotrauma</strong></li>
<li><strong>Cs For Barotrauma</strong></li>
<li><strong>Moses</strong></li>
<li><strong>Lua Utility Belt</strong></li>
<li><strong>DSSI(Dynamic Submarine Script Injector)</strong></li>
</ul>

      </div>
      
      
    
    
    
    
    
    
  
    </body></html>